/*
 * Created on 2007-10-15
 *
 * TODO
 */
package jacky.lanlan.song.extension.strecks.controller;

import org.strecks.action.basic.BasicMappingDispatchController;
import org.strecks.context.ActionContext;
import org.strecks.view.ViewAdapter;

/**
 * 通过MappingDispatch处理Action方法调用的Controller，子类可以扩展，以实现额外功能。
 * 
 * @author Jacky.Song
 */
public abstract class MappingBackedController extends BasicMappingDispatchController {

	@Override
	protected ViewAdapter executeAction(Object actionBean, ActionContext context) {
		this.beforeMappingNavigation(actionBean, context);
		// 具体的Action方法调用和页面导航委托给BasicMappingDispatchController处理
		ViewAdapter va=super.executeAction(actionBean, context);
		this.afterMappingNavigation(actionBean, context);
		return va;
	}
	
	/**
	 * 在以Mapping方式调用Action方法前要执行的操作。
	 * 
	 * @param actionBean
	 *          同executeAction()的actionBean
	 * @param context
	 *          同executeAction()的context
	 */
	protected abstract void beforeMappingNavigation(Object actionBean, ActionContext context);
	
	/**
	 * 在以Mapping方式调用Action方法后要执行的操作。
	 * 
	 * @param actionBean
	 *          同executeAction()的actionBean
	 * @param context
	 *          同executeAction()的context
	 */
	protected abstract void afterMappingNavigation(Object actionBean, ActionContext context);
	
	
}